package com.loong.common.constant;


import com.google.common.collect.Lists;
import com.loong.common.domain.Pager;

import java.util.stream.IntStream;

/**
 * @Description:
 * @Author: hzp
 * @Date: 2020-12-25 17:28
 */
public class SingletonPager {
    private SingletonPager(){};
    private enum Singleton{
        INSTANCE;
        private final Pager instance;
        Singleton(){
            instance=new Pager(Lists.newArrayList());
        }
        public Pager getInstance(){
            return instance;
        }
    }
    public static Pager getInstance(){
        return Singleton.INSTANCE.getInstance();
    }
//    public static void main(String[] args) {
//        IntStream.rangeClosed(1, 100).
//                forEach(i->new Thread(String.valueOf(i)){
//                    public void run() {
//                        System.out.println(SingletonPager.getInstance()==SingletonPager.getInstance());
//                    }
//                }.start());
//    }
}
